/** 
 * Description:首页推荐管理
 * Date:2013-1-9
 * Author:Along	
*/
package com.community.shopping.service.logic;
import java.util.List;

import org.hibernate.Query;

import com.community.shopping.dao.IndexGroupDao;
import com.community.shopping.domain.IndexGroup;
public class IndexGroupManager {
	
	public IndexGroupDao indexGroupDao;

	/**
	 * @return the indexGroupDao
	 */
	public IndexGroupDao getIndexGroupDao() {
		return indexGroupDao;
	}

	/**
	 * @param indexGroupDao the indexGroupDao to set
	 */
	public void setIndexGroupDao(IndexGroupDao indexGroupDao) {
		this.indexGroupDao = indexGroupDao;
	}

	public IndexGroup getIndexGroupById(Integer id){
		return indexGroupDao.getIndexGroup(id);
	}
	
	public void save(IndexGroup indexGroup){
		indexGroupDao.save(indexGroup);
	}

	public void delete(IndexGroup indexGroup){		  
		indexGroupDao.delete(indexGroup);
	}
	
	public List<IndexGroup> getGroupGoods(Integer shopId,Integer kind) {  		
		 return indexGroupDao.getIndexGroup(" shopId="+shopId+" and kind="+kind+" order by sort");
		 }
	
	public int getGroupGoodsMaxSort(Integer shopId,Integer kind)
	{
		int maxSort=indexGroupDao.getMaxSort(" shopId="+shopId+" and kind="+kind);		
		return maxSort;
	}
}
